import  * as VueRouter  from "vue-router";
import { close, start } from '../components/nprogress/nprogress.ts';

const routes:any = [
    {
        path: '/admin', component: () => import('../views/admin/layout.vue'),
        children:[
            { path: '/admin/public',name:'public',role:'1',meta:{is_more:false,side_name:'企业公示',is_show:true},component: () => import('../views/admin/apply/public.vue')},
            {
                path: '/admin/approves',name:'approves',role:'approves',meta:{is_more:true,side_name:'审批流程',is_show:true,img:'',disabled:false},
                children:[
                    { path: '/admin/approve',name:'approve',role:'1',meta:{side_name:'审批流程',is_show:true},component: () => import('../views/admin/apply/index.vue')},
                    { path: '/admin/warning/cert/warning',name:'warningCertWarning',role:'1',meta:{side_name:'证书延期预警',is_show:true}, component: () => import('../views/admin/comprehensive/cert_warning.vue') },
                ]
            },
            {
                path: '/admin/applys',name:'applys',role:'applys',meta:{is_more:true,side_name:'报告申请',is_show:true,img:'',disabled:false},
                children:[
                    { path: '/admin/apply',name:'apply',role:'1',meta:{is_more:false,side_name:'用章申请',is_show:true},component: () => import('../views/admin/apply/stamp.vue')},
                    { path: '/admin/apply/down',name:'applyDown',role:'3',meta:{is_more:false,side_name:'资料下载申请',is_show:true},component: () => import('../views/admin/apply/down.vue')},
                    // { path: '/admin/apply/pay',name:'appliyPay',role:'1',meta:{side_name:'付款申请',is_show:true}, component: () => import('../views/admin/apply/pay.vue') },
                    { path: '/admin/apply/imprest',name:'applyImprest',role:'4',meta:{is_more:false,side_name:'备用金申请',is_show:true},component: () => import('../views/admin/apply/imprest.vue')},
                    { path: '/admin/apply/leave',name:'applyLeave',role:'3',meta:{is_more:false,side_name:'请假单',is_show:true},component: () => import('../views/admin/apply/leave.vue')},
                    { path: '/admin/apply/suggest',name:'applySuggest',role:'4',meta:{is_more:false,side_name:'合理化建议',is_show:true},component: () => import('../views/admin/apply/suggest.vue')},
                    { path: '/admin/apply/other',name:'applyOther',role:'4',meta:{is_more:false,side_name:'通用报告申请',is_show:true},component: () => import('../views/admin/apply/other.vue')},
                ]
            },
            {
                path: '/admin/marketing',name:'marketings',role:'marketings',meta:{is_more:true,side_name:'营销投标管理中心',is_show:true,img:'',disabled:true},
                children:[
                    { path: '/admin/marketing',name:'marketing',role:'1',meta:{side_name:'营销战略中心',is_show:true}},
                    { path: '/admin/marketing/bid',name:'marketingBid',role:'2',meta:{side_name:'投标管理中心',is_show:true}},
                ]
            },
            {
                path: '/admin/design',name:'designs',role:'designs',meta:{is_more:true,side_name:'设计研发中心',is_show:true,img:'',disabled:false},
                children:[
                    { path: '/admin/design',name:'design',role:'1',meta:{side_name:'技术研发创新',is_show:true}, component: () => import('../views/admin/design/index.vue')},
                    { path: '/admin/design/delegate',name:'designDelegate',role:'2',meta:{side_name:'委派技术团队',is_show:true}},
                    { path: '/admin/design/project',name:'designsProject',role:'3',meta:{side_name:'设计项目',is_show:true}},
                ]
            },
            {
                path: '/admin/supplier',name:'suppliers',role:'suppliers',meta:{is_more:true,side_name:'供应商资源库',is_show:true,img:'',disabled:false},
                children:[
                    { path: '/admin/supplier',name:'supplier',role:'1',meta:{side_name:'供应商入库',is_show:true}, component: () => import('../views/admin/supplier/supplier.vue')},
                    { path: '/admin/supplier/edit/:id',name:'supplierEdit',role:'2',meta:{side_name:'供应商入库',is_show:false}, component: () => import('../views/admin/supplier/edit.vue') },
                    { path: '/admin/supplier/teams',name:'supplierTeams',role:'2',meta:{side_name:'班组商入库',is_show:true}, component: () => import('../views/admin/supplier/teams.vue')},
                    { path: '/admin/supplier/teams/edit/:id',name:'teamsEdit',role:'2',meta:{side_name:'班组商入库',is_show:false}, component: () => import('../views/admin/supplier/teamsEdit.vue') },
                    {
                        path: '/admin/reference',name:'reference',role:'2',meta:{is_more:true,side_name:'企业指导价',is_show:true},
                        children:[
                            { path: '/admin/reference/material',name:'referenceMaterial',role:'5',meta:{side_name:'材料企业指导价',is_show:true}, component: () => import('../views/admin/reference/material.vue') },
                            { path: '/admin/reference/material/edit/:id',name:'referenceMaterialEdit',role:'2',meta:{side_name:'供应商入库',is_show:false}, component: () => import('../views/admin/reference/edit.vue') },
                            { path: '/admin/reference/manual',name:'referenceManual',role:'6',meta:{side_name:'人工企业指导价',is_show:true}, component: () => import('../views/admin/reference/manual.vue') },
                            { path: '/admin/reference/manual/edit/:id',name:'referenceManualEdit',role:'2',meta:{side_name:'供应商入库',is_show:false}, component: () => import('../views/admin/reference/manualEdit.vue') },
                        ]
                    },
                    
                ]
            },
            {
                path: '/admin/engineering',name:'engineerings',role:'engineerings',meta:{is_more:true,side_name:'项目管理',is_show:true,img:'',disabled:false},
                children:[
                    { path: '/admin/projects',name:'project',role:'1',meta:{side_name:'项目列表',is_show:true}, component: () => import('../views/admin/projects/index.vue') },
                    { path: '/admin/projects/info/:id',name:'projectInfo',role:'2',meta:{side_name:'项目详情',is_show:false}, component: () => import('../views/admin/projects/info.vue') },
                    { path: '/admin/labourers/edit/:id',name:'labourersEdit',role:'1',meta:{side_name:'人员花名册',is_show:false},component: () => import('../views/admin/labourers/edit.vue')},
                ],
            },
            {
                path: '/admin/comprehensives/manage',name:'comprehensiveCanages',role:'comprehensiveManages',meta:{is_more:true,side_name:'综合管理中心',is_show:true,img:'',disabled:false},
                children:[
                    {
                        path: '/admin/comprehensive',name:'comprehensives',role:'1',meta:{is_more:true,side_name:'工程综合管理部',is_show:true,img:''},
                        children:[
                            { path: '/admin/comprehensive',name:'comprehensive',role:'1',meta:{side_name:'付款审批',is_show:true}, component: () => import('../views/admin/comprehensive/index.vue') },
                            // { path: '/admin/comprehensive/warehouse',name:'comprehensiveWarehouse',role:'1',meta:{side_name:'出入库审批',is_show:true}, component: () => import('../views/admin/comprehensive/warehouse.vue') },
                            // { path: '/admin/comprehensive/invoice',name:'comprehensiveInvoice',role:'1',meta:{side_name:'甲方开票审批',is_show:true}, component: () => import('../views/admin/comprehensive/invoice.vue') },
                            // { path: '/admin/comprehensive/examine',name:'comprehensiveContract',role:'2',meta:{side_name:'签订材料劳务合同',is_show:true},component: () => import('../views/admin/comprehensive/contract.vue')},
                            { path: '/admin/comprehensive/cost',name:'comprehensiveCost',role:'2',meta:{side_name:'项目成本统计',is_show:true},component: () => import('../views/admin/comprehensive/costs.vue')},
                            // { path: '/admin/comprehensive/approve',name:'comprehensiveApprove',role:'2',meta:{side_name:'审批申请',is_show:true},component: () => import('../views/admin/comprehensive/approve.vue')},
                            { path: '/admin/comprehensive/approval_process',name:'comprehensiveAapprovalProcess',role:'2',meta:{side_name:'审批流程设置',is_show:true},component: () => import('../views/admin/comprehensive/approval_process.vue')},
                            // { path: '/admin/comprehensive/cost/show/:id',name:'comprehensiveCostShow',role:'2',meta:{side_name:'项目成本统计',is_show:false},component: () => import('../views/admin/comprehensive/costShow.vue')},
                            { path: '/admin/comprehensive/cost/ledger/:id',name:'comprehensiveCostLedger',role:'2',meta:{side_name:'项目台账',is_show:false},component: () => import('../views/admin/comprehensive/costLedger.vue')},
                        ]
                    },
                    {
                        path: '/admin/finance',name:'finances',role:'finances',meta:{is_more:true,side_name:'财务部门',is_show:true,img:''},
                        children:[
                            { path: '/admin/finance/salary',name:'financeSalary',role:'1',meta:{side_name:'员工工资发放',is_show:true},component: () => import('../views/admin/finance/salary.vue')},
                            { path: '/admin/finance',name:'finance',role:'1',meta:{side_name:'项目财务付款',is_show:true},component: () => import('../views/admin/finance/index.vue')},
                            { path: '/admin/finance/capitalize',name:'financeCapitalize',role:'1',meta:{side_name:'项目融资台账',is_show:true},component: () => import('../views/admin/finance/capitalize.vue')},
                            { path: '/admin/finance/capitalize/edit/:id',name:'financeCapitalizeEdit',role:'1',meta:{side_name:'项目融资台账',is_show:false},component: () => import('../views/admin/finance/editCapitalize.vue')},
                            
                            // { path: '/admin/finance/reimburse',name:'financeReimburse',role:'1',meta:{side_name:'报销单',is_show:true},component: () => import('../views/admin/finance/reimburse.vue')},
                            // { path: '/admin/finance/opex',name:'financeOpex',role:'1',meta:{side_name:'公司年运营费用',is_show:true},component: () => import('../views/admin/finance/opex.vue')},
                            { path: '/admin/finance/monthEndPay',name:'financeMonthEndPay',role:'1',meta:{side_name:'月底付款',is_show:true},component: () => import('../views/admin/finance/monthEndPay.vue')},
                            // { path: '/admin/finance/reimburse/edit/:id',name:'financeReimburseEdit',role:'1',meta:{side_name:'报销单',is_show:false},component: () => import('../views/admin/finance/editReimburse.vue')},
                            // { path: '/admin/finance/monthEndPay/edit/:id',name:'financeMonthEndPayEdit',role:'1',meta:{side_name:'月底付款',is_show:false},component: () => import('../views/admin/finance/editMonthEndPay.vue')},
                            // { path: '/admin/finance/ledger',name:'financeLedger',role:'1',meta:{side_name:'项目成本管台账',is_show:true},component: () => import('../views/admin/finance/index.vue')},
                            // { path: '/admin/finance/summary',name:'financeSummary',role:'1',meta:{side_name:'员工薪资汇总表',is_show:true},component: () => import('../views/admin/finance/index.vue')},
                        ]
                    },
                    {
                        path: '/admin/hr',name:'hrs',role:'hrs',meta:{is_more:true,side_name:'人力资源部部门',is_show:true,img:''},
                        children:[
                            { path: '/admin/hr',name:'hrInfo',role:'1',meta:{side_name:'员工信息管理',is_show:true}, component: () => import('../views/admin/hr/index.vue') },
                            { path: '/admin/hr/user/edit/:id',name:'hrUserEdit',role:'1',meta:{side_name:'员工信息管理',is_show:false}, component: () => import('../views/admin/hr/edit.vue') },
                            { path: '/admin/hr/cert',name:'hrCert',role:'1',meta:{side_name:'证书管理',is_show:true}, component: () => import('../views/admin/hr/cert.vue') },
                            { path: '/admin/hr/cert/edit/:id',name:'hrCertEdit',role:'1',meta:{side_name:'企业证书管理',is_show:false}, component: () => import('../views/admin/hr/editCert.vue') },
                            { path: '/admin/hr/train',name:'hrTrain',role:'1',meta:{side_name:'员工培训管理',is_show:true}},
                            { path: '/admin/hr/hire',name:'hrHire',role:'1',meta:{side_name:'员工招聘',is_show:true}},
                        ]
                    },
                ]
            },
            {
                path: '/admin/party',name:'partys',role:'partys',meta:{is_more:true,side_name:'企业党建',is_show:true,img:'',disabled:true},
                children:[
                    { path: '/admin/party/member',name:'partyMember',role:'1',meta:{side_name:'党员管理',is_show:true}},
                    { path: '/admin/party/union',name:'partyUnion',role:'2',meta:{side_name:'工会管理',is_show:true}},
                    { path: '/admin/party/joint',name:'partyJoint',role:'3',meta:{side_name:'党建共建',is_show:true}},
                    { path: '/admin/party/welfare',name:'partyWelfare',role:'4',meta:{side_name:'员工福利创收',is_show:true}},
                ]
            },
        ]
    },
    {path: '/admin/login',name:'adminLogin',component: () => import('../views/admin/login.vue'),children:[]},
    {path: '/face/:id',name:'face',component: () => import('../views/face.vue'),children:[]},
    {path: '/',name:'index',component: () => import('../views/index.vue'),children:[]},

]
  
const router = VueRouter.createRouter({
    scrollBehavior:() => ({ left:0,top:0 }),
    history: VueRouter.createWebHashHistory(),
    routes,
})

router.beforeEach(() => {
	start();
})
 
router.afterEach(() => {
	close();
})

export default router